(define (add-stream x y)
  (stream-map + x y))
(define (mul-stream x y)
  (stream-map * x y))
(define (div-stream x y)
  (stream-map / x y))

(define ones (cons-stream 1 ones))
(define integrates (cons-stream 1 (add-stream ones integrates)))

(define (integrate-series x)
  (mul-stream x (div-stream ones integrates)))

(define exp-series
  (cons-stream 1 (integrate-series exp-series)))
(define cosine-series
  (cons-stream 1 (integrate-series sine-series)))
(define sine-series
  (cons-stream 0 (integrate-series cosine-series)))


(define (scale-stream str x)
  (cons-stream (* (stream-car str) x)
	       (scale-stream (stream-cdr str) x)))
(define (mul-series series1 series2)
  (cons-stream (scale-stream series1 (stream-car series2))
	       (cons-stream 0 (mul-series (stream-cdr series2) series1))))

(define (the-one-over series)
  (define zeros
    (cons-stream 0 zeros))
  (define const-1
    (cons-stream 1 zeros))
  (define X
    (add-stream const-1
		(mul-stream X
			    (scale-stream (stream-cdr series) -1)))))

(define (div-series x y)
					;x / y
  (let ((scalor (/ 1(stream-car y))))
    (mul-stream x
		(scale-stream (the-one-over (scale-stream y scalor)) scalor))))
